﻿using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using HZ.MBSM.DBUtility;

public partial class Supervise_PROLIST : System.Web.UI.Page,HZ.MBSM.BLL.IPageDescribe
{
    protected void Page_Load(object sender, EventArgs e)
    {

        if (HZ.MBSM.BLL.Login.CheckAssert(this.UseAccountType))
        {
            GetProjectData();
        }
    }

    public void GetProjectData()
    {
        string sql;
        Db db = new Db();
        System.Data.IDataReader dr;
        sql = @"  select ProjectMarker,project.projectid,project.title,count(bidid) as tbNum,count(distinct project_bid.AccountId) as tbrNum,
                 count(distinct accountid_sc) as scNum
                ,sum(case when project_bid.checkstatus='1' then 1 else 0 end ) as SHTG
                ,sum(case when project_bid.smPrice>0 then 1 else 0 end) as BJSL
                from project left join project_bid on project.projectid=project_bid.projectid inner join goods on project_bid.goodsid=goods.goodsid
                group by project.ProjectMarker,project.title,project.projectid order by project.projectid desc
                ";
        dr = db.DataReader(sql);
        this.GridView1.DataSource = dr;
        this.GridView1.DataBind();
        dr.Close();
        dr.Dispose();
        db.Close();
    }

    #region IPageDescribe 成员


    public string Describe
    {
        get { return ""; }
    }
    public string Name
    {
        get { return "招标项目列表"; }
    }
    public string ParentName
    {
        get { return "招标项目列表"; }
    }

    public System.Collections.Generic.List<HZ.MBSM.DAL.AccountType> UseAccountType
    {
        get
        {
            System.Collections.Generic.List<HZ.MBSM.DAL.AccountType> _AccountType = new System.Collections.Generic.List<HZ.MBSM.DAL.AccountType>();
            _AccountType.Add(HZ.MBSM.DAL.AccountType.enumSupervise);
            return _AccountType;
        }
    }

    #endregion
}

 